﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Users/Manage.Master" AutoEventWireup="true" CodeBehind="ManageHome.aspx.cs" Inherits="OnlineAuction.Users.ManageHome" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph_Css" runat="server">
    <style type="text/css">
        .style1 {
            width: 706px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph_TopBar" runat="server">
    <div id="dv_TopBar">
        <a href="AddItems.aspx">ADD NEW</a>
        <span style="color: red">|</span>
        <a href="ItemsDisabled.aspx">RECYCLE BIN</a>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cph_Content" runat="server">
    <table cellpadding="5" cellspacing="5" class="style1">
        <caption style="font-size: larger; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FF6600">Items Selling</caption>
        <tr>
            <td style="text-align: center">
                <asp:ScriptManager ID="scriptManager1" runat="server" EnablePartialRendering="true" />
                <asp:UpdatePanel ID="UpdtPnlForGrdVw" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Timer runat="server" ID="UpdateTimer" Interval="5000" OnTick="UpdateTimer_Tick" />
                        <asp:GridView ID="grvItems" runat="server" AutoGenerateColumns="false" Width="679px"
                            OnRowCommand="grvItems_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="Item ID">
                                    <ItemTemplate>
                                        <asp:Label ID="lbItemID" runat="server" Text='<%# Bind("ItemID") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Item Name">
                                    <ItemTemplate>
                                        <asp:Label ID="lbItemName" runat="server" Text='<%# Bind("ItemName") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Expectation Price">
                                    <ItemTemplate>
                                        <asp:Label ID="lbExpectationPrice" runat="server" Text='<%# Bind("ExpectationPrice") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Current Price">
                                    <ItemTemplate>
                                        <asp:Label ID="lbCurrentPrice" runat="server" Text='<%# Bind("Price") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Time Finish Auction">
                                    <ItemTemplate>
                                        <asp:Label ID="lbTimeFinishAuction" runat="server" Text='<%# Bind("TimeFinishAuction") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Auction type">
                                    <ItemTemplate>
                                        <asp:Label ID="lbAuctionType" runat="server" Text='<%# Bind("AuctionTypeName") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Show">
                                    <ItemTemplate>
                                        <a href='../Bid.aspx?AuctionID=<%#Eval("AuctionID") %>'>Show</a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Disable">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbDisable" runat="server" CommandName="Disable"
                                            CommandArgument='<%# Eval("AuctionID")+"-"+Eval("AuctionTypeName") %>' Text="Disable"
                                            OnClientClick="return confirm('Do you want to finish auction session now?');" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Edit">
                                    <ItemTemplate>
                                        <a href='EditItems.aspx?AuctionID=<%#Eval("AuctionID") %>'>Edit</a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataTemplate>
                                <asp:Label ID="lbEmpty" runat="server" Text="Can't find any items" />
                            </EmptyDataTemplate>
                        </asp:GridView>
                        <cc1:CollectionPager ID="cpItemsSelling" runat="server" SectionPadding="10" SliderSize="5">
                        </cc1:CollectionPager>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td style="height: 30px; text-align: center" />
        </tr>
    </table>
</asp:Content>
